package com.cheng.service.appversion;

import com.cheng.dao.appversion.AppVersionDao;
import com.cheng.pojo.AppVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@SuppressWarnings("all")
public class AppVersionServiceImpl implements AppVersionService {
    @Autowired
    private AppVersionDao appVersionDao;

    @Override
    public AppVersion getAppVersionById(AppVersion appVersion) {
        return appVersionDao.getAppVersionById(appVersion);
    }

    @Override
    public List<AppVersion> getHistoryVersionById(int id) {
        return appVersionDao.getAppHistoryVersionInfoById(id);
    }

    @Override
    public int addVersion(AppVersion appVersion) {
        appVersionDao.addAppVersion(appVersion);
        int count = appVersionDao.updateAppInfoVersionId(appVersion.getAppId());
        return count;
    }
}
